using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class LevelCollider : MonoBehaviour
{
    public Animator animator;
    public void FadeToNextLevel()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }

    private void OnCollisionEnter2D(Collision2D collision)
    {
        animator.SetTrigger("FadeOut");
        Debug.Log("Collision into next level");
    }

    //private void OnTriggerEnter2D(Collision2D collision)
    //{
    //    animator.SetTrigger("FadeOut");
    //    Debug.Log("Collision into next level");
    //}
}
